﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace HWR_Ants.Classes
{
    public class City
    {
        private string _Name;
        private Point _Coord;
        private Dictionary<City, Road> _Roads;

        public City(string name, Point coord)
        {
            _Name = name;
            _Coord = coord;
            _Roads = new Dictionary<City, Road>();
        }

        public string Name
        {
            get { return _Name; }
        }

        public Point Coord
        {
            get { return _Coord; }
        }

        public IEnumerable<City> NeighbourCities
        {
            get { return _Roads.Keys; }
        }

        public Road Roads(City city)
        {
            Road ret = null;
            _Roads.TryGetValue(city, out ret);
            return ret;
        }

        internal void AddRoad(Road road, City city)
        {
            _Roads.Add(city, road); 
        }
    }
}
